<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class UpdateBlindRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     */
    public function authorize(): bool
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
     */
    public function rules(): array
    {
        return [
            'name' => ['required'],
            "url" => ['required'],
            "price" => ['required', 'regex:/^\d+(\.\d{1,2})?$/'],
            "blind_cate_id" => ['required'],
            "blind_type" => ['required'],
            "type" => ['required'],
            'shops' => ['required'],
            'stock_quantity' => ['required'],
            "tend_time" => ['date_format:Y-m-d H:i:s']
        ];
    }
}
